﻿
using System;
using System.Threading;
using System.Threading.Tasks;

namespace WSU.ChekaParallel.TestParallelClass
{
    static class TestParallelInvoke
    {
        private static void SimpleTest1()
        {
            Parallel.Invoke(
                () => { Thread.Sleep(500); Console.WriteLine("1. task done on thread<{0}>", Thread.CurrentThread.ManagedThreadId); },
                () => { Thread.Sleep(200); Console.WriteLine("2. task done on thread<{0}>", Thread.CurrentThread.ManagedThreadId); }
                );
            Console.WriteLine("main thread blocked until all parallel works are finished.");
        }

        public static void TestMain()
        {
            SimpleTest1();
        }
    }
}